
#include "gtest/gtest.h"

#include "Chain.h"
#include "ChainIterator.h"

TEST( ChainIteratorTest, Simple )
{
    Chain<int> L;
    L.Insert( 0, 2 );
    L.Insert( 1, 6 );
    L.Insert( 2, 8 );
    L.Insert( 1, 4 );

    ChainIterator<int> p;
    int* q = p.Initialize(L);

    int data;
    int idx = 0;
    while ( q ) {
        ++idx;
        L.Find( idx, data );
        EXPECT_EQ( data, *q );
        q = p.Next();
    }
}

#include "main_stub.h"

